{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "DEFAULT_INITIAL_BASKET = [\"orange\", \"apple\"]\n",
    "\n",
    "def create_picnic_basket(healthy, hungry, initial_basket=DEFAULT_INITIAL_BASKET):\n",
    "    basket = initial_basket\n",
    "    if healthy:\n",
    "        basket.append(\"strawberry\")\n",
    "    else:\n",
    "        basket.append(\"jam\")\n",
    "\n",
    "    if hungry:\n",
    "        basket.append(\"sandwich\")\n",
    "    return basket"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First basket: ['orange', 'apple', 'strawberry']\n"
     ]
    }
   ],
   "source": [
    "print(\"First basket:\", create_picnic_basket(True, False))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Second basket: ['tea', 'jam', 'sandwich']\n"
     ]
    }
   ],
   "source": [
    "print(\"Second basket:\", create_picnic_basket(False, True, [\"tea\"]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Third basket: ['orange', 'apple', 'strawberry', 'strawberry', 'sandwich']\n"
     ]
    }
   ],
   "source": [
    "print(\"Third basket:\", create_picnic_basket(True, True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_picnic_basket(healthy, hungry, basket=None):\n",
    "    if basket is None:\n",
    "        basket = [\"orange\", \"apple\"]\n",
    "    if healthy:\n",
    "        basket.append(\"strawberry\")\n",
    "    else:\n",
    "        basket.append(\"jam\")\n",
    "    if hungry:\n",
    "        basket.append(\"sandwich\")\n",
    "    return basket"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "First basket: ['orange', 'apple', 'strawberry']\n"
     ]
    }
   ],
   "source": [
    "print(\"First basket:\", create_picnic_basket(True, False))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Second basket: ['tea', 'jam', 'sandwich']\n"
     ]
    }
   ],
   "source": [
    "print(\"Second basket:\", create_picnic_basket(False, True, [\"tea\"]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Third basket: ['orange', 'apple', 'strawberry', 'sandwich']\n"
     ]
    }
   ],
   "source": [
    "print(\"Third basket:\", create_picnic_basket(True, True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
